<table class="table content-table">
    <thead>
    <tr>
        <th style="width: 20px">
            选择
            <input type="checkbox" ng-model="allChecked"
                   ng-change="updateSelectContentAll({allChecked:allChecked})">
        </th>
        <th style="display: none">场景Id</th>
        <th style="display: none">内容Id</th>
        <th style="width: 25px; display: none">状态</th>
        <!--扩展属性哈哈哈哈-->
        <th ng-repeat="(key, val) in contentSchema" ng-if="val['showInList']===undefined || val['showInList']">
            {{val['title']}}
        </th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <tr ng-repeat="contentItem in content" ng-class="{  active: $index%2==0 }">
        <td>
            <input type="checkbox" ng-model="contentItem.checked"
                   ng-change="updateSelectContent({contentItem:contentItem})">
        </td>
        <td style="display: none">{{contentItem.sceneId}}</td>
        <td style="display: none">{{contentItem.sceneContentId}}</td>

        <td ng-switch="contentItem.state" style="display: none">
            <span ng-switch-when="3">已排期</span>
            <span ng-switch-when="-1">删除</span>
            <span ng-switch-when="0">未排期</span>
            <span ng-switch-default>默认</span>
        </td>
        <!--扩展属性哈哈哈哈-->
        <td ng-repeat="(keyItem, valItem) in contentSchema"
            ng-if="valItem['showInList']===undefined || valItem['showInList']"
            ng-switch="valItem['utype']">
            <span ng-switch-when="itemid">
                <input type="text" class="form-control" ng-model="contentItem.content[keyItem]"/>
                <a href="//item.taobao.com/item.htm?id={{contentItem.content[keyItem]}}" target="_blank">{{contentItem.content[keyItem]}}</a>
            </span>
            <span ng-switch-when="img,url" style="display: flex; flex-direction: row">
                <img src="{{contentItem.content[keyItem]}}" width="50px" height="50px" style="margin-right: 2px"/>
                <input type="text" class="form-control" ng-model="contentItem.content[keyItem]" my-url-validation="" placeholder="不要加http前缀哦"/>
            </span>
            <span ng-switch-when="img">
                <input type="text" class="form-control" ng-model="contentItem.content[keyItem]" my-url-validation="" placeholder="不要加http前缀哦"/>
                <img src="{{contentItem.content[keyItem]}}" width="50px"/>
            </span>
            <span ng-switch-when="itemtitle">
                <input type="text" class="form-control" ng-model="contentItem.content[keyItem]" style="width: 150px"/>
            </span>

            <span ng-switch-when="url">
                <input type="text" class="form-control" ng-model="contentItem.content[keyItem]" style="width: 150px" my-url-validation="" placeholder="不要加http前缀哦"/>
            </span>

            <span ng-switch-default>
                <input type="text" class="form-control" ng-model="contentItem.content[keyItem]"/>
            </span>
        </td>
        <td>
            <button class="btn btn-primary btn-sm" style="margin-top: 5px;"
                    ng-show="contentItem.state!=-1 && contentItem.id"
                    ng-click="deleteContent({contentItem:contentItem})">删除
            </button>
            <button ng-show="updateContent" class="btn btn-primary btn-sm" style="margin-top: 5px;"
                    ng-click="updateContent({contentItem:contentItem})">更新
            </button>
            <button ng-show="couldTop" class="btn btn-primary btn-sm" style="margin-top: 5px;"
                    ng-click="topContent({contentItem:contentItem})">
                <span ng-if="!contentItem.isTop || contentItem.isTop==0">置顶</span>
                <span ng-if="contentItem.isTop==1">取消置顶</span>
            </button>
        </td>
    </tr>
    </tbody>
</table>